package test;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URI;
import java.net.URL;

import org.springframework.util.FileCopyUtils;

public class GetLog {
	public static final String logUrl="http://10.5.17.115:8080/qbfront.my.17173.com_stdout.log";
	public static void main(String[] args) throws Exception {
		URL url = new URL(logUrl);
		InputStream is = new BufferedInputStream(url.openStream());
		File file = new File("d:\\temp\\log.log");
		if(file.exists()){
			file.delete();
		}
		file.createNewFile();
		OutputStream os = new BufferedOutputStream(new FileOutputStream(file));
		
		FileCopyUtils.copy(is, os);
	}
}
